import 'package:fate_blind_box/chat_view/ahu_text.dart';
import 'package:fate_blind_box/config/app_style.dart';
import 'package:fate_blind_box/utils/default/widget_extension_utils.dart';
import 'package:fate_blind_box/widget/meet_appbar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'logic.dart';

class MemberAddPage extends GetView<MemberAddLogic> {
  const MemberAddPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: const MeetAppBar(title: '添加员工'),
      backgroundColor: '#FFFFFF'.stringToColor,
      body: SingleChildScrollView(
        padding: EdgeInsets.symmetric(horizontal: 14.w),
        child: TextField(
            controller: controller.state.textEditingController,
            textAlign: TextAlign.left,
            style: TextStyle(color: const Color(0xff333333), fontSize: 16.sp),
            autofocus: false,
            //光标颜色
            cursorColor: "FE5E31".stringToColor,
            minLines: 1,
            maxLines: 1,
            inputFormatters: <TextInputFormatter>[
              LengthLimitingTextInputFormatter(12),
              // FilteringTextInputFormatter.allow(
              //     Config.defaultReg),
              //限制长度
            ],
            textAlignVertical: TextAlignVertical.center,
            decoration: InputDecoration(
              labelStyle:
                  TextStyle(color: const Color(0xff999999), fontSize: 14.sp),
              hintText: '请输入姓名',
              hintStyle:
                  TextStyle(color: const Color(0xffAAAAAA), fontSize: 14.sp),
              contentPadding:
                  EdgeInsets.symmetric(vertical: 14.w, horizontal: 14.w),
              focusedBorder: OutlineInputBorder(
                borderSide: const BorderSide(color: Colors.transparent),
                borderRadius: BorderRadius.circular(5.w), // 设置圆角大小
              ),
              enabledBorder: OutlineInputBorder(
                borderSide: const BorderSide(color: Colors.transparent),
                borderRadius: BorderRadius.circular(5.w), // 设置圆角大小
              ),
              filled: true,
              fillColor: '#F6F6F6'.stringToColor,
              isCollapsed: false,
              isDense: true,
            )),
      ),
      bottomNavigationBar: Container(
        height: ScreenUtil().bottomBarHeight + 84.w,
        alignment: Alignment.center,
        decoration: BoxDecoration(color: Colors.white, boxShadow: [
          BoxShadow(
            color: '#21000000'.stringToColor,
            offset: Offset(4.w, 2.w),
            blurRadius: 2.w,
            spreadRadius: 4.w,
          ),
        ]),
        child: Container(
            alignment: Alignment.center,
            height: 44.w,
            margin: EdgeInsets.symmetric(horizontal: 44.w),
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(22.w),
                color: '#614AC0'.stringToColor,
                boxShadow: [
                  BoxShadow(
                    color: '#7F69D9'.stringToColor,
                    offset: Offset(2.w, 2.w),
                    blurRadius: 4,
                    spreadRadius: 2,
                  ),
                ]),
            child: const AhuText(
              text: '确认添加',
              color: Colors.white,
              fontSize: 18,
              fontWeight: FontWeight.w600,
            )).clickAction(tapAction: () => controller.addMember()),
      ),
    );
  }
}
